package com.atguigu.tingshu.album.client;

import com.atguigu.tingshu.album.client.impl.CategoryDegradeFeignClient;
import com.atguigu.tingshu.model.album.BaseCategory3;
import com.atguigu.tingshu.model.album.BaseCategoryView;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * <p>
 * 产品列表API接口
 * </p>
 *
 * @author qy
 */
@FeignClient(value = "service-album",
        fallback = CategoryDegradeFeignClient.class,
        contextId = "categoryFeignClient"
)
public interface CategoryFeignClient {
    /**
     * 根据三级分类id获取分类数据
     * @param category3Id 三级分类id
     * @return 分类数据
     */
    @GetMapping("client/album/category/getBaseCategoryView/{id}")
    BaseCategoryView getCategoryView(@PathVariable("id") Long category3Id);


    /**
     * 获取一级分类id下TOP7的三级分类
     * @param category1Id 一级分类id
     * @return 三级分类
     */
    @GetMapping("client/album/category/findTopBaseCategory3/{category1Id}")
    List<BaseCategory3> findTopBaseCategory3(@PathVariable("category1Id") Long category1Id);

}